package logs;

import java.io.FileNotFoundException;
import java.util.Formatter;

public class CreateTextFile 
{	
	private Formatter output;
	
	public void openFile() 
	{
		try 
		{
			output = new Formatter("logFile.txt");
		}
		catch(SecurityException securityException) 
		{
			System.err.println("You do not have write access to this file.");
			System.exit(1);
		}
		catch(FileNotFoundException fileNotFoundException) 
		{
			System.err.println("Error creating file.");
			System.exit(1);
		}		
	}
	
	public void closeFile() 
	{
		if(output != null)
			output.close();
	}
}